//
//  BackHeaderView.swift
//  旅航ios
//
//  Created by tulip on 2021/5/14.
//

import UIKit

class BackHeaderView: UIView {

    var title:UILabel!
  
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        let back=UIButton.init(frame: CGRect(x: 0, y:StatusBarHeight + 13, width: 39, height: 17))
        back.setImage(UIImage(named: "back-1"), for: .normal)
        back.addTarget(self, action: #selector(popback), for: .touchUpInside)
        self.addSubview(back)
        

        
        title=UILabel.init(frame: CGRect(x: SCREEN_WIDTH/2.0-80, y: StatusBarHeight+13, width: 160, height: 18))
        title.textAlignment = .center
        title.textColor=UIColor.init(hexString: "333333")
        title.font=UIFont.systemFont(ofSize: 18)
        self.addSubview(title)
        
       
    }
    
   
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setTitle(str:String){
        title.text=str
    }
    
    @objc func popback(){
        getCurrentVc().navigationController?.popViewController(animated: true)
    }

}
